﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace GameNode
{
    class Node
    {
        public int X { get; set; }
        public int Y { get; set; }
        private Random rnd;
  

        public Node(int x, int y)
        {
            X = x;
            Y = y;
            rnd = new Random();
            //Thread.Sleep(100);
        }

        public void MoveUp()
        { Y--; }

        public void MoveDown()
        { Y++; }

        public void MoveLeft()
        { X--; }

        public void MoveRight()
        { X++; }

        public bool IsOnPossition(int positionX, int positionY)
        {
            if(X == positionX && Y == positionY)
                return true;
            return false;
        }


     


    }

    class ConsoleNode : Node
    {
        public char NodeSymbol { get; private set; }
        public ConsoleColor NodeColor { get; private set; }

        public ConsoleNode(int x, int y, char nodeSymbol, ConsoleColor nodeColor)
            : base(x, y)
        {
            NodeSymbol = nodeSymbol;
            NodeColor = nodeColor;
        }

    }

    

}

